function getFakeCaptcha(req, res) {
  return res.json('captcha-xxx');
} // 代码中会兼容本地 service mock 以及部署站点的静态数据

import Cookies from 'js-cookie';

export default {
  'GET /api/config': {
    "code": 200,
    "data": {
      apps: [
        {
          name: 'sub-app-1',
          entry: '//localhost:8001',
        },
      ]
    },
    "msg": ""
  },
  // 支持值为 Object 和 Array
  'GET /api/user/get/current/user': {
    "code": 200,
    "msg": "操作成功",
    "data": {
      "id": 1,
      "tenantId": 1,
      "loginName": "13900000001",
      "username": "超级管理员",
      "mobile": "13900000001",
      "password": "8a59bba2559534b4d0dd0f546091d677",
      "salt": "701574",
      "idCard": "330327199005224278",
      "department": "基础部门",
      "state": 1,
      "createTime": "2020-08-18T16:44:21",
      "updateTime": "2020-09-02T11:55:43"
    }
  },
  // GET POST 可省略
  'GET /api/users': [
    {
      key: '1',
      name: 'John Brown',
      age: 32,
      address: 'New York No. 1 Lake Park',
    },
    {
      key: '2',
      name: 'Jim Green',
      age: 42,
      address: 'London No. 1 Lake Park',
    },
    {
      key: '3',
      name: 'Joe Black',
      age: 32,
      address: 'Sidney No. 1 Lake Park',
    },
  ],
  'POST /api/auth/login': (req, res) => {
    Cookies.set('token', '123456');
    res.send({
      code: 200,
      msg: '',
    });
  },
  'GET /api/auth/logout': (req, res) => {
    res.send({
      code: 200,
      msg: '',
    });
  },
  'GET /api/500': (req, res) => {
    res.status(500).send({
      timestamp: 1513932555104,
      code: 500,
      error: 'error',
      message: 'error',
      path: '/base/category/list',
    });
  },
  'GET /api/404': (req, res) => {
    res.status(404).send({
      timestamp: 1513932643431,
      status: 404,
      error: 'Not Found',
      message: 'No message available',
      path: '/base/category/list/2121212',
    });
  },
  'GET /api/403': (req, res) => {
    res.status(403).send({
      timestamp: 1513932555104,
      status: 403,
      error: 'Unauthorized',
      message: 'Unauthorized',
      path: '/base/category/list',
    });
  },
  'GET /api/401': (req, res) => {
    res.status(401).send({
      timestamp: 1513932555104,
      status: 401,
      error: 'Unauthorized',
      message: 'Unauthorized',
      path: '/base/category/list',
    });
  },
  'GET  /api/auth/captcha/img': getFakeCaptcha,
};
